package com.willian.andrappfw.network;

import java.io.Serializable;

public class WBaseResponse<T> implements Serializable {
    private int code;
    private T data;
    private String message;
    private boolean success;

    public int getCode() {
        return code;
    }

    public T getData() {
        return data;
    }

    public String getMessage() {
        return message;
    }

    public boolean isSuccess() {
        return success;
    }

    public static boolean isSuccess(WBaseResponse baseResponse) {
        if (baseResponse != null && baseResponse.isSuccess() && baseResponse.getCode() == 200) {
            return true;
        } else {
            return false;
        }
    }
}
